//
//  FYAlertTooler.m
//  FYAgent
//
//  Created by 于龙 on 15/11/20.
//  Copyright © 2015年 Foryou. All rights reserved.
//

#import "FYAlertTooler.h"
#import "AppDelegate.h"

@interface FYAlertTooler()

@end

@implementation FYAlertTooler
static FYAlertTooler *_shareInstance = nil;

+ (FYAlertTooler *)sharedInstance {
    
    if (!_shareInstance) {
        
        _shareInstance = [[FYAlertTooler alloc] init];
    }
    return _shareInstance;
}

- (void)showAlertTitle:(NSString *)title
               message:(NSString *)msg
             btnTitles:(id)titles
            btnClicked:(void (^)(NSInteger))click{
    UIAlertView *alertView = [[UIAlertView alloc] init];
    alertView.title = title;
    alertView.message = msg;
    
    for (NSString *buttonTitle in titles) {
        [alertView addButtonWithTitle:buttonTitle];
    }

    
    alertView.tapBlock = ^(UIAlertView *alertView, NSInteger buttonIndex) {
        click(buttonIndex);
    };
    
    
    [alertView show];
}

@end
